package model
{
	import mx.formatters.DateFormatter;
	import mx.formatters.Formatter;
	import mx.formatters.NumberFormatter;
	import mx.utils.StringUtil;
	
	import okl.test.motionChart.interfaces.IMotionBubbleData;

	public class BubbleData implements IMotionBubbleData
	{
		//data.addColumn('string', 'Category'); data.addColumn('date', 'Date'); data.addColumn('number', 'Score'); data.addColumn('number', 'Volume'); d
		public function BubbleData()
		{
		}
		
		private var _category:String;
		private var _date:Date;
		private var _score:Number;
		private var _volume:Number;
		
		
		public function get date():Date
		{
			return _date;
		}

		public function set date(value:Date):void
		{
			_date = value;
		}

		public function get score():Number
		{
			return _score;
		}

		public function set score(value:Number):void
		{
			_score = value;
		}

		public function get volume():Number
		{
			return _volume;
		}

		public function set volume(value:Number):void
		{
			_volume = value;
		}

		public function get category():String
		{
			return _category;
		}

		public function set category(value:String):void
		{
			_category = value;
		}

		public function toString():String{
			var df:DateFormatter = new DateFormatter();
			df.formatString="DD HH:MM";
			var nf:NumberFormatter = new NumberFormatter();
			nf.precision=2;
			return StringUtil.substitute("Vol:{2}; Sco:{3} Cat:{0}; Dat:{1}; ", category.substr(0, 4), df.format(date), nf.format(volume), nf.format(score));
		}
		
	}
}